<!--
  -    Copyright (c) 2018-2025, hycloud All rights reserved.
  -
  - Redistribution and use in source and binary forms, with or without
  - modification, are permitted provided that the following conditions are met:
  -
  - Redistributions of source code must retain the above copyright notice,
  - this list of conditions and the following disclaimer.
  - Redistributions in binary form must reproduce the above copyright
  - notice, this list of conditions and the following disclaimer in the
  - documentation and/or other materials provided with the distribution.
  - Neither the name of the pig4cloud.com developer nor the names of its
  - contributors may be used to endorse or promote products derived from
  - this software without specific prior written permission.
  - Author: hycloud
  -->
  <template>
    <div class="execution">
        <basic-container>
            <avue-crud ref="crud" :page.sync="page" :data="tableData" :permission="permissionList"
                :table-loading="tableLoading" :option="tableOption" @on-load="getList" @search-change="searchChange"
                @refresh-change="refreshChange" @size-change="sizeChange" @current-change="currentChange">
                <template #menu="{ row, index, size }">
                    
                </template>
            </avue-crud>
        </basic-container>
    </div>
</template>

<script>
import RenderForm from '@/components/table-design/newRender'
import addView from '@/mixins/addView'
import { mapGetters } from 'vuex'

export default {
    components: { RenderForm },
    mixins: [addView],
    name: 'historyalarm',
    data() {
        return {
            formObj: {
                code: 'asset_allocationone_bill',
                title: '',
                flag: 'start',
                bizData: {}
            },
            bizId: '',
            unitId: '',
            unitName: '',
            validityDate: '',
            modal: false,
            modal1: false,
            modal2: false,
            modal3: false,
            searchForm: {},
            tableData: [ {
                alarmName: '1楼烟雾报警',
                alarmLevel: 0,
                alarmTime: '2023-12-20 12:00:30',
                status: 1,
                dealSuggest:"已经及时处理，未造成损失"
            }, {
                alarmName: '4楼电压报警',
                alarmLevel: 1,
                alarmTime: '2023-11-20 12:00:30',
                status: 1,
                dealSuggest:"已经及时处理，未造成损失"
            }
            ],
            page: {
                total: 0, // 总页数
                currentPage: 1, // 当前页数
                pageSize: 20 // 每页显示多少条
            },
            tableLoading: false,
            tableOption: {
                "border": true,
                "index": true,
                "indexLabel": "序号",
                "stripe": true,
                "menuAlign": "center",
                "align": "center",
                "dialogClickModal": false,
                "searchMenuSpan": 6,
                "viewBtnIcon":'el-icon-view',
                "viewBtnText": '查看',
                editBtnText: '处理',
                addBtn:true,
                viewBtn:true,

                "column": [
                    {
                        "type": "input",
                        "label": "报警名称",
                        "prop": "alarmName",
                        width: 300,
                        search: true,
                        editDisabled:true
                    },
                    {
                        "type": "select",
                        "label": "报警级别",
                        "prop": "alarmLevel",
                        searchLabelWidth: 150,
                        width: 300,
                        search: true,
                        dataType: 'number',
                        dicData: [{
                            label: '一般报警',
                            value: 0
                        },{
                            label: '次要报警',
                            value: 1
                        },{
                            label: '重要报警',
                            value: 2
                        }],
                        editDisabled:true
                    },
                    {
                        "type": "datetime",
                        "label": "报警时间",
                        "prop": "alarmTime",
                        searchLabelWidth: 150,
                        width: 300,
                        search: false,
                        editDisabled:true
                    }, 
                    {
                        "type": "select",
                        "label": "处理状态",
                        "prop": "status",
                        searchLabelWidth: 150,
                        width: 300,
                        search: true,
                        dataType: 'number',
                        dicData: [{
                            label: '未处理',
                            value: 0
                        },{
                            label: '已处理',
                            value: 1
                        }],
                    },{
                        "type": "textarea",
                        "label": "处理意见",
                        "prop": "dealSuggest",
                        width: 600,
                        search: false,
                        overHidden: true,   
                    },{
                        "type": "datetime",
                        "label": "开始时间",
                        "prop": "startTime",
                        searchLabelWidth: 150,
                        width: 200,
                        search: true,
                        editDisplay:false,
                        addDisplay:false,
                        viewDisplay:false,
                        hide:true
                    },{
                        "type": "datetime",
                        "label": "结束时间",
                        "prop": "endTime",
                        searchLabelWidth: 150,
                        width: 200,
                        search: true,
                        editDisplay:false,
                        addDisplay:false,
                        viewDisplay:false,
                        hide:true
                    }]
            }
        }
    },
    computed: {
        ...mapGetters(['permissions', 'tagList']),
        permissionList() {
            return {
                addBtn: false,
                delBtn: false,
                editBtn: true
            };
        }
    },
    methods: {
    }
}
</script>


<style lang="scss">
.el-radio {
    color: #000000;
}
</style>
